package com.hy.schedule.entity;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * author: Mr.Du
 * Date: 2023/6/9
 * Time: 14:21
 */
@Data
@Slf4j
public class Task implements Runnable {
    
    private Long id;
    
    private String name;    // 任务名字
    
    private String cron;    // 触发条件
    
    public Task(Long id, String name, String cron) {
        this.id = id;
        this.name = name;
        this.cron = cron;
    }
    
    @Override
    public void run() {
        log.info("当前任务序号：{}", id);
    }
}
